package com.lsf.dunlian.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;

import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;

import com.lsf.dunlian.R;
import com.lsf.dunlian.adapter.MonthRecyclerViewAdapter;
import com.lsf.dunlian.databinding.ActivityAttendanceRecordBinding;
import com.lsf.dunlian.entity.AttendanceEntity;

import java.util.ArrayList;
import java.util.List;

public class  AttendanceRecordActivity extends Activity {
    private ActivityAttendanceRecordBinding binding;
    private MonthRecyclerViewAdapter monthRecyclerViewAdapter;
    private List<AttendanceEntity> monthEntityList = new ArrayList<>();

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        BaseUtils.setStatusBar(this);
        binding = DataBindingUtil.inflate(LayoutInflater.from(this), R.layout.activity_attendance_record, null, false);
        setContentView(binding.getRoot());
        init();
    }
    private void init(){
        AttendanceEntity entity = new AttendanceEntity();
        entity.title="正常打卡";
        entity.number="22";
        entity.color=getResources().getColor(R.color.green);
        monthEntityList.add(entity);

        AttendanceEntity entity1 = new AttendanceEntity();
        entity1.title="迟到打卡";
        entity1.number="22";
        entity1.color=getResources().getColor(R.color.red);
        monthEntityList.add(entity1);

        AttendanceEntity entity2 = new AttendanceEntity();
        entity2.title="早退打卡";
        entity2.number="22";
        entity2.color=getResources().getColor(R.color.red);
        monthEntityList.add(entity2);

        AttendanceEntity entity3 = new AttendanceEntity();
        entity3.title="缺勤天数";
        entity3.number="1";
        entity3.color=getResources().getColor(R.color.huangse);
        monthEntityList.add(entity3);

        AttendanceEntity entity4 = new AttendanceEntity();
        entity4.title="请假天数";
        entity4.number="22";
        entity4.color=getResources().getColor(R.color.red);
        monthEntityList.add(entity4);

        monthRecyclerViewAdapter = new MonthRecyclerViewAdapter(monthEntityList,this);
        binding.datRecyclerView.setLayoutManager(new GridLayoutManager(this,3));
        binding.datRecyclerView.setAdapter(monthRecyclerViewAdapter);
    }
}
